package cool.taomu.toolkit.test

import com.google.inject.Key
import com.google.inject.name.Names
import cool.taomu.toolkit.TaomuConfigure
import cool.taomu.toolkit.TaomuGuice
import cool.taomu.toolkit.TaomuGuiceServiceLoader
import cool.taomu.toolkit.crypto.Base64
import cool.taomu.toolkit.jsch.service.IJschConnection
import cool.taomu.toolkit.jsch.service.JschUtils
import org.junit.jupiter.api.Test
import cool.taomu.toolkit.Context

class JschConfigTest {

	@Test
	def void a() {
		val TaomuConfigure config = new TaomuConfigure(new Base64())
		config.loadConfig
		var injector = TaomuGuice.createInjector(config)
		TaomuGuiceServiceLoader.loadIPlatform(injector,config)
		var context = injector.getInstance(Context);
		var ins = context.injectorSupplier.get().getInstance(Key.get(IJschConnection,Names.named("taomu.jsch.name.proxy")))
		var ssh = new JschUtils(ins)
		println(ssh.Ssh.exec("ls -l ","UTF-8"))
	}
}
